void main() {
  // 准备购物车数据
  List carts = [
    {"count": 2, "price": 10.0, "selected": false},
    {"count": 1, "price": 30.0, "selected": true},
    {"count": 5, "price": 20.0, "selected": true}
  ];
  bool AllSelected = isAllSelected(carts);
  print(AllSelected ? '全选' : '未全选');
}

//封账函数判断全部是否选中
bool isAllSelected(List carts) {
  bool AllSelected = true;
  for (var item in carts) {
    if (item['selected'] == false) {
      AllSelected = false;
      break;
    }
  }
  return AllSelected;
}
